package tools.gff;

import java.util.ArrayList;
import java.util.Iterator;

public class GFF3node {

	private gffLine cur;
	private ArrayList<GFF3node> children;
	private ArrayList<GFF3node> derivatives;
	
	public GFF3node(gffLine cur){
		this.cur=cur;
		children= new ArrayList<GFF3node>();
		derivatives= new ArrayList<GFF3node>();
	}
	
	public void addChild(GFF3node child){
		children.add(child);
	}
	
	public void addDerivative(GFF3node derivative){
		derivatives.add(derivative);
	}
	
	public Iterator<GFF3node> iterateChildren(){
		return children.iterator();
	}
	
	public int derivativesSize(){
		return derivatives.size();
	}
	
	public GFF3node getFirstDerivative(){
		return getDerivative(0);
	}
	
	public GFF3node getDerivative(int n){
		return derivatives.get(n);
	}
	
	public Iterator<GFF3node> iterateDerivatives(){
		return derivatives.iterator();
	}
	
	public gffLine getCur(){
		return cur;
	}
}
